import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/indexview'
  },
  {
    path: '/login',
    component: () => import('@/views/login.vue')
  },
  {
    path: '/quickinquiry',
    component: () => import('@/views/QuickInquiry/index.vue')
  },
  {
    path: '/selectdepartment',
    component: () => import('@/views/SelectDepartment/index.vue')
  },
  {
    path: '/indexview',
    component: () => import('@/views/indexview.vue')
  },
  {
    path: '/indexpage',
    component: () => import('@/views/indexpage/indexpage.vue'),
    children: [
      {
        path: '/',
        component: () => import('@/views/article/article.vue')
      },
      {
        path: '/mypage',
        component: () => import('@/views/mypage/mypage.vue')
      },
      {
        path: '/articlepage',
        component: () => import('@/views/article/article.vue')
      },
      {
        path: '/messagepage',
        component: () => import('@/views/message/message.vue')
      },
      {
        path: '/healthypage',
        component: () => import('@/views/healthy/healthy.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
